public class PrintNameThread implements Runnable {

	
	private Thread thread;
	
	public PrintNameThread(String name) {
		setThread(new Thread(this, name));
		getThread().start();
	}

	@Override
	public void run() {
		System.out.println("My name is " + getThread().getName());

	}

	public Thread getThread() {
		return thread;
	}

	public void setThread(Thread thread) {
		this.thread = thread;
	}


}